﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Air_condition.DO
{
    [Serializable]
    //  Entity for Glass
    class Glass
    {
        //  instance the vars
        //Emm
        private double dbeffectCoefficient;
        //Em
        private double dbglassCoefficient;
        //nt
        private double dbimmediateCoefficient;
        //Rmax
        private double dbsolarRadition;
        private int iwindowFrameType;
        private double dbarea;
        private string sname;
        private int itypeofglass;
        private int ilatitute;
        private int itimeofsun;
        private int imonth;
        private int ipressure;
        private int itime;
        private int idirection;
        private int isolarHour;

        public int iSolarHour
        {
            get { return isolarHour; }
            set { isolarHour = value; }
        }


        public int iDirection
        {
            get { return idirection; }
            set { idirection = value; }
        }

        public int iTime
        {
            get { return itime; }
            set { itime = value; }
        }

        public int iPressure
        {
            get { return ipressure; }
            set { ipressure = value; }
        }

        public int iMonth
        {
            get { return imonth; }
            set { imonth = value; }
        }

        public int iTimeofsun
        {
            get { return itimeofsun; }
            set { itimeofsun = value; }
        }


        public int iLatitute
        {
            get { return ilatitute; }
            set { ilatitute = value; }
        }

        public int iTypeofglass
        {
            get { return itypeofglass; }
            set { itypeofglass = value; }
        }

        public string sName
        {
            get{ return sname; }
            set { sname = value; }
        }

        //  set/get score effect
        public double dbEffectCoefficient
        {
            get { return dbeffectCoefficient; }
            set { dbeffectCoefficient = value; }
        }
        //  set/get score glass
        public double dbGlassCoefficient
        {
            get { return dbglassCoefficient; }
            set { dbglassCoefficient = value; }

        }
        //  set/get solar immediate
        public double dbImmediateCoefficient
        {
            get { return dbimmediateCoefficient; }
            set { dbimmediateCoefficient = value; }

        }
        //  set/get solar radition 
        public double dbSolarRadition
        {
            get { return dbsolarRadition; }
            set { dbsolarRadition = value; }
        }

        public int iWindowFrameType
        {
            get { return iwindowFrameType; }
            set { iwindowFrameType = value; }
        }

        public double dbArea
        {
            get { return dbarea; }
            set { dbarea = value; }
        }

        //  Tính nhiệt bức xạ qua kính Q11
        public double CalculateGlassRadiationHeat()
        {
            double dbglassArea = 0;
            //  Nếu là khung gỗ
            if (iwindowFrameType == 0)
            {
                dbglassArea = 0.85 * dbarea;
                dbeffectCoefficient = 1;
            }
            else
            {
                //  Nếu là khung kim loại
                dbglassArea = dbarea;
                dbeffectCoefficient = 1.17;
            }

            return dbimmediateCoefficient * dbglassArea * dbsolarRadition * dbeffectCoefficient * dbglassCoefficient;
        }

    }
}
